package main

import (
	"github.com/gin-gonic/gin"
	"net/http"
)

func Auth(ctx *gin.Context) {
	if uid:=getUidFromCookie(ctx); uid!=""{
		ctx.Set("uid", uid)
		ctx.Next()
	} else {
		ctx.String(http.StatusForbidden, "身份校验失败，请重新登录")
		ctx.Abort()
	}
}
